import work.*;
public class Main {
    public static void main(String[] args) {
        Zoo zoo = new Zoo();
        zoo.addAnimal(new Tiger("普通老虎", 200, 5, "橙色带黑色条纹"));
        zoo.addAnimal(new Lion("普通狮子", "金色",3,60));
        zoo.addAnimal(new Lizard("7岁的蜥蜴", 30, "绿色",7,200));
        zoo.addAnimal(new Goldfish("金鱼", 0.2, "红色"));
        Tiger testNewTiger = new Tiger();
        testNewTiger.setAge(2);
        testNewTiger.setWeight(50);
        testNewTiger.setName("小老虎");
        zoo.addAnimal(testNewTiger);
        System.out.println("动物园现有动物：");
        zoo.displayAnimals();

        // 更新老虎信息
        Tiger newTiger = new Tiger("新老虎", 220, 6, "深橙色带黑色条纹");
        zoo.updateAnimal(zoo.findAnimalByName("Tiger"), newTiger);

        System.out.println("更新后的动物园动物：");
        zoo.displayAnimals();

        newTiger.makeSound();
        // 查找并显示狮子信息
        Animal foundAnimal = zoo.findAnimalByName("Lion");
        if (foundAnimal != null) {
            System.out.println("找到动物：" + foundAnimal.getClass().getSimpleName());
            foundAnimal.displayDetails();
        } else {
            System.out.println("未找到指定动物。");
        }

        // 删除金鱼
        zoo.removeAnimal(zoo.findAnimalByName("Goldfish"));

        System.out.println("删除动物后的动物园：");
        zoo.displayAnimals();
    }
}